package cz.khfotbal.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "TEAM")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Team {

	@Id
	@GeneratedValue
	private int id;

	private String name;
	private Integer number;
	private String playTime;
	private String playDay;
	private String frontName;

	@OneToMany(mappedBy = "team", cascade = CascadeType.ALL)
	private Set<SeasonCompetionTeam> seasonCompetionTeams;

	@ManyToOne
	@JoinColumn(name = "USER_ID")
	private User user;

	@Transient
	private ResultData resultData = new ResultData();

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<SeasonCompetionTeam> getSeasonCompetionTeams() {
		return seasonCompetionTeams;
	}

	public void setSeasonCompetionTeams(
			Set<SeasonCompetionTeam> seasonCompetionTeams) {
		this.seasonCompetionTeams = seasonCompetionTeams;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	public String getPlayTime() {
		return playTime;
	}

	public void setPlayTime(String playTime) {
		this.playTime = playTime;
	}

	public String getPlayDay() {
		return playDay;
	}

	public void setPlayDay(String playDay) {
		this.playDay = playDay;
	}

	public ResultData getResultData() {
		return resultData;
	}

	public void setResultData(ResultData resultData) {
		this.resultData = resultData;
	}

	public String getFrontName() {
		return frontName;
	}

	public void setFrontName(String frontName) {
		this.frontName = frontName;
	}

}
